<?php
namespace Plugin\Attractions\AttractionManagement\Schema\Attraction_tourist_info;

use Plugin\Attractions\AttractionManagement\Model\AttractionUserTouristInfo;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 游客信息表
 */
#[Schema(title: 'AttractionUserTouristInfoSchema')]
class AttractionUserTouristInfoSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'user_id', title: '所属用户id', type: 'int')]
    public string $user_id;

    #[Property(property: 'name', title: '游客姓名', type: 'varchar')]
    public string $name;

    #[Property(property: 'phone', title: '游客手机号', type: 'varchar')]
    public string $phone;

    #[Property(property: 'id_card', title: '游客身份证', type: 'varchar')]
    public string $id_card;

    #[Property(property: 'created_at', title: 'created_at', type: 'datetime')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'datetime')]
    public string $updated_at;

    #[Property(property: 'deleted_at', title: 'deleted_at', type: 'timestamp')]
    public string $deleted_at;




    public function __construct(AttractionUserTouristInfo $model)
    {
       $this->id = $model->id;
       $this->user_id = $model->user_id;
       $this->name = $model->name;
       $this->phone = $model->phone;
       $this->id_card = $model->id_card;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;
       $this->deleted_at = $model->deleted_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'user_id' => $this->user_id ,'name' => $this->name ,'phone' => $this->phone ,'id_card' => $this->id_card ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at ,'deleted_at' => $this->deleted_at];
    }
}